package report;

import java.util.ArrayList;
import java.util.Arrays;
import transfer.PopularityReport;

/**
 *
 * @author Oleh
 */
public class PopularityReportData extends ReportData {

    public PopularityReportData(ArrayList date) {
        super(date);
    }

    public void setTitle() {
        title = "Popularity Report";
    }

    public void setHeaders() {
        String[] stringHeaders = new String[]{"warehouse","commodity","quantity"};
        headers = new ArrayList();
        headers.addAll(Arrays.asList(stringHeaders));
    }

    public ArrayList parseDataItem(Object item) {
        ArrayList result = new ArrayList();
        PopularityReport popularityReport = (PopularityReport) item;
        result.add(popularityReport.warehouse);
        result.add(popularityReport.commodity);
        result.add(popularityReport.quantity);
        return result;
    }
}
